/**
 * org.vz.product.vserv.pf.impl
 * @since : jdk 1.8
 */
package org.vz.product.vserv.pf.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.vz.product.vserv.pf.dao.ReceivedSerExceptionAndWaitCountDao;
import org.vz.product.vserv.pf.domain.ReceivedSerCount;
import org.vz.product.vserv.pf.domain.result.ReceivedSerCountResult;
import org.vz.product.vserv.pf.service.ReceivedSerExceptionAndWaitCountService;

/**
 * @author morik is Yongxu.Wang 获取时间段服务异常待处理总数
 * @CreateTime 2017年12月05日 16:11:23
 * @version 1.0.0
 * @description 
 */
@Service
public class ReceivedSerExceptionAndWaitCountServiceImpl implements
		ReceivedSerExceptionAndWaitCountService {
	@Autowired
	ReceivedSerExceptionAndWaitCountDao receivedSerExceptionAndWaitCountDao;
	@Override
	public ReceivedSerCountResult receivedSerExceptionAndWaitCountService(
			String startTime, String endTime) {
		ReceivedSerCountResult rscr = new ReceivedSerCountResult();
		Map<String, String> prmgr = new HashMap<String, String>();
		prmgr.put("startTime", startTime);
		prmgr.put("endTime", endTime);
		List<ReceivedSerCount> data = receivedSerExceptionAndWaitCountDao
				.getSQLManager().select("seroperations.getSerExceputionCount",
						ReceivedSerCount.class, prmgr);
		rscr.msg = "查询成功！！！";
		rscr.status = 1;
		for (ReceivedSerCount receivedSerCount : data) {
			rscr.data.count += receivedSerCount.getCount();
		}
		return rscr;
	}
}
